Skip to content

fix: increase agent evaluation and apply timeouts for slow models - #165

Open
cwbcheng wants to merge 1 commit into
jeremymcs:mainfrom
cwbcheng:pr/agent-timeouts
Open

fix: increase agent evaluation and apply timeouts for slow models#165
cwbcheng wants to merge 1 commit into
jeremymcs:mainfrom
cwbcheng:pr/agent-timeouts

Conversation

@cwbcheng

@cwbcheng cwbcheng commented Aug 5, 2026

Copy link
Copy Markdown

Problem

Fixed timeouts in server/agentRunner.ts are too tight for slower model providers (e.g. DeepSeek via a LiteLLM bridge), which causes two failure modes:

  1. Evaluation timeout (3 min, 180000). Evaluating whether a long review comment needs a fix routinely exceeds 3 minutes for models with slower first-token/long-context latency. An evaluation timeout fails the whole run and pushes the PR into recovery mode; recovery runs never trigger the code-owner fallback, so the run just fails.

  2. Apply timeout (15 min, 900000). Multi-file fixes (e.g. editing contract shapes plus regenerating ~20 fixtures) exceed 15 minutes. When apply is killed mid-run, the uncommitted worktree edits are discarded.

Changes

server/agentRunner.ts:

  • Evaluation timeout: 180000420000 (7 min) for both codex and claude evaluation.
  • Default apply timeout: 9000001800000 (30 min), matching the code-owner fallback timeout (CODE_OWNER_FALLBACK_TIMEOUT_MS).

Tests

Existing timeout tests still pass (they assert the formatted timeout string from stderr, not the default).

Environment

  • Node.js 22, WSL2, codex CLI 0.146.0 (DeepSeek-backed provider)

The DeepSeek-backed codex agent frequently times out on long review
comments: evaluation had a 3-minute cap and apply had a 15-minute cap,
which was not enough for multi-file fixes (e.g. 21 generated fixtures).
When apply timed out mid-run, the uncommitted worktree edits were
discarded.

Raise evaluation to 7 minutes and the default apply timeout to 30
minutes (matching the code-owner fallback timeout) so complex review
threads can be evaluated and fixed to completion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant